<template>
		<view v-if="!isloading">{{ text }}</view>
		<view v-else class="ing">订单采集中({{ text }})</view>
</template>

<script>
	export default {
		data() {
			return {
				text: '待采集',
				isloading: false
			};
		},
		methods: {
			start() {
				let self = this;
				this.text = 60;
				this.isloading = true;
				let timer = setInterval(() => {
					if (this.text == 0) {
						clearInterval(timer);
						this.end();
						return;
					}
					self.text -= 1;
				}, 1000);
			},
			end() {
				this.text = '采集完成';
				this.isloading = false;
			}
		}
	}
</script>

<style lang="scss" scoped>
	.container {
		view {
			padding: 10rpx 16rpx;
			// width: 168rpx;
			border-radius: 24rpx;
			color: #FE4400;
			text-align: center;
			font-size: 24rpx;
			margin-right: 12rpx;
			background: #FFECE5;
		}
		.ing {
			background-color: #FFECE5;
			color: $main-color;
			border: none;
		}
	}
</style>
